/*
* @Author: Administrator
* @Date:   2016-11-21 18:14:52
* @Last Modified by:   Administrator
* @Last Modified time: 2016-11-23 09:45:41
*/

'use strict';

var marked = require('marked');
var pygmentize = require('pygmentize-bundled');
var markdownString = '## hello';

// Async highlighting with pygmentize-bundled
marked.setOptions({
  highlight: function (code, lang, callback) {
    pygmentize({ lang: lang, format: 'html' }, code, function (err, result) {
      callback(err, result.toString());
    });
  }
});


// Using async version of marked
marked(markdownString, function (err, content) {
  if (err) throw err;
  console.log(content);
});
